package com.ruoyi.quartz.task;

import com.ruoyi.business.service.ICollectionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @desc 催收短信回查
 * @Author: pengguochao
 * @Date: 2022/3/25
 */
@Slf4j
@Component("collectionSmsBackToCheckTask")
public class CollectionSmsBackToCheckTask {

    @Autowired
    ICollectionService collectionService;

    public void execute() {
        log.info("催收短信任务回查 Start >>>>>>>>>>");

        try {
            //将未发送的催收任务状态改为0
           int result =  collectionService.updateCollectionSmsTaskIsSend();
           log.info("催收未发送的短信任务回查 共 ：" + result +"  条");
        } catch (Exception e) {
            log.error("催收短信任务回查 执行异常", e);

        }
        log.info("催收短信任务回查 End >>>>>>>>>>");
    }
}
